<!DOCTYPE HTML>

<html>
    <head>
    	  <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
   
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <!--
    <meta name="viewport"
          content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
    <meta http-equiv="Cache-Control" content="no-siteapp"/> -->
        <link rel="stylesheet" href="__STATIC__/css/screen.css" media="screen" />
        <link rel="stylesheet" href="__STATIC__/css/print.css" media="print" />
        <title>学员信息拍照录入</title>
		<script language="javascript" type="text/javascript" src="__STATIC__/js/jquery.min.js"></script>
		<script language="javascript" type="text/javascript" src="__STATIC__/js/jquery-migrate-1.2.1.min.js"></script>
		<script language="javascript" type="text/javascript" src="__STATIC__/js/jquery.jqprint.js"></script>
        <script language="javascript" type="text/javascript">
		        var DeviceMain;//主头
		        var DeviceAssist;//副头
		        var VideoMain;//主头
		        var VideoAssist;//副头
				var videoCapMain; 
				var videoCapAssist;	
				
		        var PicPath;
				var initFaceDetectSuccess;
				var readIDcard = false;
				
		        function plugin()
                {
                    return document.getElementById('view1');
                }
	
                function MainView()
                {
                    return document.getElementById('view1');
                }
        
		        function AssistView()
                {
                    return document.getElementById('view2');
                }
		
		        function thumb1()
                {
                    return document.getElementById('thumb1');
                }
		
		        function addEvent(obj, name, func)
                {
                    if (obj.attachEvent) {
                        obj.attachEvent("on"+name, func);
                    } else {
                        obj.addEventListener(name, func, false); 
                    }
                }
		        function OpenVideo()
		        {
					
		            OpenVideoMain();
			        OpenVideoAssist();
		        }
		        function CloseVideo()
		        {
		            CloseVideoMain();
			        CloseVideoAssist();
		        }
		        function CloseVideoMain()
		        {
		            if (VideoMain)
			        {
				        plugin().Video_Release(VideoMain);
				        VideoMain = null;
				
					    MainView().View_SetText("", 0);
			        }			
		        }
		        function CloseVideoAssist()
		        {
			        if (VideoAssist)
			        {
				        plugin().Video_Release(VideoAssist);
				        VideoAssist = null;

				        AssistView().View_SetText("", 0);
			        }
		        }
		
		        function OpenVideoMain()
		        {
		            CloseVideoMain();

		            if (!DeviceMain)
		                return;
			
			        var sSubType = document.getElementById('subType1'); 								
			        var sResolution = document.getElementById('selRes1'); 	
				
			        var SelectType = 0;
			        var txt;
			        if(sSubType.options.selectedIndex != -1)
			        {
				        txt = sSubType.options[sSubType.options.selectedIndex].text;
				        if(txt == "YUY2")
				        {
					        SelectType = 1;
				        }
				        else if(txt == "MJPG")
				        {
					        SelectType = 2;
				        }
				        else if(txt == "UYVY")
				        {
					        SelectType = 4;
				        }
			        }
			
			        var nResolution = sResolution.selectedIndex;
					
					
			        VideoMain = plugin().Device_CreateVideo(DeviceMain, nResolution, SelectType);
			        if (VideoMain)
			        {
					    MainView().View_SelectVideo(VideoMain);
					    MainView().View_SetText("打开视频中，请等待...", 0);
							
			        }
		        }

		        function OpenVideoAssist()
		        {
		            CloseVideoAssist();

		            if (!DeviceAssist)
		                return;
			
			        var sSubType = document.getElementById('subType2'); 								
			        var sResolution = document.getElementById('selRes2'); 	
				
			        var SelectType = 0;
			        var txt;
			        if(sSubType.options.selectedIndex != -1)
			        {
				        txt = sSubType.options[sSubType.options.selectedIndex].text;
				        if(txt == "YUY2")
				        {
					        SelectType = 1;
				        }
				        else if(txt == "MJPG")
				        {
					        SelectType = 2;
				        }
				        else if(txt == "UYVY")
				        {
					        SelectType = 4;
				        }
			        }
			
			        var nResolution = sResolution.selectedIndex;
							
			        VideoAssist = plugin().Device_CreateVideo(DeviceAssist, nResolution, SelectType);
			        if (VideoAssist)
			        {
					    AssistView().View_SelectVideo(VideoAssist);
					    AssistView().View_SetText("打开视频中，请等待...", 0);		
			        }	
		        }
		
		        function changesubTypeMain()
		        {
			        if (DeviceMain)
			        {	
				        var sSubType = document.getElementById('subType1'); 								
				        var sResolution = document.getElementById('selRes1'); 	
				        var SelectType = 0;
				        var txt;
				        if(sSubType.options.selectedIndex != -1)
				        {
					        var txt = sSubType.options[sSubType.options.selectedIndex].text;
					        if(txt == "YUY2")
					        {
						        SelectType = 1;
					        }
					        else if(txt == "MJPG")
					        {
						        SelectType = 2;
					        }
					        else if(txt == "UYVY")
					        {
						        SelectType = 4;
					        }
				        }
									
				        var nResolution = plugin().Device_GetResolutionCountEx(DeviceMain, SelectType);
				        sResolution.options.length = 0; 
				        for(var i = 0; i < nResolution; i++)
				        {
					        var width = plugin().Device_GetResolutionWidthEx(DeviceMain, SelectType, i);
					        var heigth = plugin().Device_GetResolutionHeightEx(DeviceMain, SelectType, i);
					        sResolution.add(new Option(width.toString() + "*" + heigth.toString())); 
				        }
				        sResolution.selectedIndex = 0;
			        }			
		        }

		        function changesubTypeAssist()
		        {
			        if (DeviceAssist)
			        {	
				        var sSubType = document.getElementById('subType2'); 								
				        var sResolution = document.getElementById('selRes2'); 	
				
				        var SelectType = 0;
				        var txt;
				        if(sSubType.options.selectedIndex != -1)
				        {
					        var txt = sSubType.options[sSubType.options.selectedIndex].text;
					        if(txt == "YUY2")
					        {
						        SelectType = 1;
					        }
					        else if(txt == "MJPG")
					        {
						        SelectType = 2;
					        }
					        else if(txt == "UYVY")
					        {
						        SelectType = 4;
					        }
				        }			
				
				        var nResolution = plugin().Device_GetResolutionCountEx(DeviceAssist, SelectType);
				        sResolution.options.length = 0; 
				        for(var i = 0; i < nResolution; i++)
				        {
					        var width = plugin().Device_GetResolutionWidthEx(DeviceAssist, SelectType, i);
					        var heigth = plugin().Device_GetResolutionHeightEx(DeviceAssist, SelectType, i);
					        sResolution.add(new Option(width.toString() + "*" + heigth.toString())); 
				        }
				        sResolution.selectedIndex = 0;
			        }			
		        }	
		
                function Load()
                {
			        //设备接入和丢失
			        //type设备类型， 1 表示视频设备， 2 表示音频设备
			        //idx设备索引
			        //dbt 1 表示设备到达， 2 表示设备丢失
                    addEvent(plugin(), 'DevChange', function (type, idx, dbt) 
					{
						if(1 == type)//视频设备
						{
							if(1 == dbt)//设备到达
							{
								var deviceType = plugin().Global_GetEloamType(1, idx);
								if(1 == deviceType)//主摄像头
								{
									if(null == DeviceMain)
									{
										DeviceMain = plugin().Global_CreateDevice(1, idx);										
										if(DeviceMain)
										{
											document.getElementById('lab1').innerHTML = plugin().Device_GetFriendlyName(DeviceMain);
											
											var sSubType = document.getElementById('subType1');
											sSubType.options.length = 0;
											var subType = plugin().Device_GetSubtype(DeviceMain);
											if (subType & 1) 
											{
												sSubType.add(new Option("YUY2"));
											}
											if (subType & 2) 
											{
												sSubType.add(new Option("MJPG"));
											}
											if (subType & 4) 
											{
												sSubType.add(new Option("UYVY"));
											}
											
											sSubType.selectedIndex = 1; //初始化时使用图片的格式，0是YUY2, 1是MJPG
											changesubTypeMain();
											
											OpenVideoMain();
											
										}
									}
								}
								else if(2 == deviceType || 3 == deviceType)//辅摄像头
								{
									if(null == DeviceAssist)
									{
										DeviceAssist = plugin().Global_CreateDevice(1, idx);										
										if(DeviceAssist)
										{
											document.getElementById('lab2').innerHTML = plugin().Device_GetFriendlyName(DeviceAssist);
											
											var sSubType = document.getElementById('subType2');
											sSubType.options.length = 0;
											var subType = plugin().Device_GetSubtype(DeviceAssist);
											if (subType & 1) 
											{
												sSubType.add(new Option("YUY2"));
											}
											if (subType & 2) 
											{
												sSubType.add(new Option("MJPG"));
											}
											if (subType & 4) 
											{
												sSubType.add(new Option("UYVY"));
											}
											if ((0 != (subType & 2)) && (0 != (subType & 1)))//辅摄像头优先采用mjpg模式打开 
											{
												sSubType.selectedIndex = 1; //初始化时使用图片的格式，0是YUY2, 1是MJPG
											}
											else 
											{
												sSubType.selectedIndex = 0;
											}
											initFaceDetectSuccess = plugin().InitFaceDetect();
											
											changesubTypeAssist();
											
											OpenVideoAssist();
		
										}
									}
								}
							}
							else if(2 == dbt)//设备丢失
							{
								if (DeviceMain) 
								{
                                    if (plugin().Device_GetIndex(DeviceMain) == idx) 
									{
                                        CloseVideoMain();
                                        plugin().Device_Release(DeviceMain);
                                        DeviceMain = null;
										
										document.getElementById('lab1').innerHTML = "";
										document.getElementById('subType1').options.length = 0; 
										document.getElementById('selRes1').options.length = 0; 
                                    }
                                }
								
                                if (DeviceAssist) 
								{
                                    if (plugin().Device_GetIndex(DeviceAssist) == idx) 
									{
                                        CloseVideoAssist();
                                        plugin().Device_Release(DeviceAssist);
                                        DeviceAssist = null;
										
										document.getElementById('lab2').innerHTML = "";
										document.getElementById('subType2').options.length = 0; 
										document.getElementById('selRes2').options.length = 0; 
                                    }
                                }
							}
						}
                    });

			        addEvent(plugin(), 'Ocr', function(flag, ret)
			        {
				        if (1 == flag && 0 == ret)
				        {
					        var ret = plugin().Global_GetOcrPlainText(0);
					        alert(ret);
				        }
			        });
			
			        addEvent(plugin(), 'IdCard', function(ret)
			        {
				        if (1 == ret)
				        {
					        var str = GetTimeString() + "：";
					
					        for(var i = 0; i < 16; i++)
					        {
						        str += plugin().Global_GetIdCardData(i + 1);
						        str += ";";				
					        }
				
					        document.getElementById("idcard").value=str;	
							
							var image = plugin().Global_GetIdCardImage(1);//1表示头像， 2表示正面， 3表示反面 ...
							plugin().Image_Save(image, "C:\\idcard.jpg", 0);
							plugin().Image_Release(image);
							
							document.getElementById("idcardimg").src= "C:\\idcard.jpg";
				        }
			        });
			
			        addEvent(plugin(), 'Biokey', function(ret)
			        {
				        if (4 == ret)
				        {
					        // 采集模板成功
					        var mem = plugin().Global_GetBiokeyTemplateData();
					        if (mem)
					        {
						        if (plugin().Memory_Save(mem, "C:\\1.tmp"))
						        {
							        document.getElementById("biokey").value="获取模板成功，存储路径为C:\\1.tmp";
						        }						
						        plugin().Memory_Release(mem);
					        }
					
					        var img = plugin().Global_GetBiokeyImage();
					        plugin().Image_Save(img, "C:\\BiokeyImg1.jpg", 0);
					        plugin().Image_Release(img);
					
					        document.getElementById("BiokeyImg1").src= "C:\\BiokeyImg1.jpg";					
					        alert("获取指纹模板成功");
				        }
				        else if (8 == ret)
				        {
					        var mem = plugin().Global_GetBiokeyFeatureData();
					        if (mem)
					        {
						        if (plugin().Memory_Save(mem, "C:\\2.tmp"))
						        {
							        document.getElementById("biokey").value="获取特征成功，存储路径为C:\\2.tmp";
						        }						
						        plugin().Memory_Release(mem);
					        }
					
					        var img = plugin().Global_GetBiokeyImage();
					        plugin().Image_Save(img, "C:\\BiokeyImg2.jpg", 0);
					        plugin().Image_Release(img);
					
					        document.getElementById("BiokeyImg2").src= "C:\\BiokeyImg2.jpg";
					        alert("获取指纹特征成功");
				        }
				        else if (9 == ret)
				        {
					        document.getElementById("biokey").value += "\r\n刷的不错！";
				        }
				        else if (10 == ret)
				        {
					        document.getElementById("biokey").value+= "\r\n图像质量太差！";
				        }
				        else if (11 == ret)
				        {
					        document.getElementById("biokey").value+= "\r\n图像点数太少！";
				        }
				        else if (12 == ret)
				        {
					        document.getElementById("biokey").value+= "\r\n太快！";
				        }
				        else if (13 == ret)
				        {
					        document.getElementById("biokey").value+= "\r\n太慢！";
				        }
				        else if (14 == ret)
				        {
					        document.getElementById("biokey").value+= "\r\n其它质量问题！";
				        }				
			        });
			
			        addEvent(plugin(), 'Reader', function(type, subtype)
			        {
				        var str = "";
				        if (4 == type)
				        {
							if( 0 == subtype)//接触式CPU卡
							{
								str += "[接触式CPU卡][银行卡号]:";
								str += plugin().Global_ReaderGetCpuCreditCardNumber();
							}
							else if( 1 == subtype)//非接触式CPU卡
							{
								str += "[非接触式CPU卡] :";
								str += "[Id]:";
								str += plugin().Global_ReaderGetCpuId();
								str += "[银行卡号]:";
								str += plugin().Global_ReaderGetCpuCreditCardNumber();
								
								str += "[磁道数据]:";
								str += plugin().Global_CpuGetBankCardTrack();//磁道数据
								
								str += "[交易记录]:";
								var n = plugin().Global_CpuGetRecordNumber();//交易条数
								for(var i = 0; i < n; i++)
								{
									str += plugin().Global_CpuGetankCardRecord(i);
									str + ";";
								}			
							}							
						}
				        else if (2 == type)
				        {
					        str += "[M1卡] Id:";
					        str += plugin().Global_ReaderGetM1Id();
				        }
				        else if (3 == type)
				        {
					        str += "[Memory卡] Id:";
					        str += plugin().Global_ReaderGetMemoryId();	
				        }
				        else if (5 == type)
				        {
					        str += "[社保卡] :";
					        str += plugin().Global_ReaderGetSocialData(1);
					        str += plugin().Global_ReaderGetSocialData(2);
				        }
				        document.getElementById("reader").value=str;
			        });
			
			        addEvent(plugin(), 'Mag', function(ret)
			        {
				        var str = "";
				
				        str += "[磁卡卡号] ";
				        str += plugin().Global_MagneticCardGetNumber();
				
				        str += "[磁道数据]";		

				        str += "磁道1:";					
				        str += plugin(). Global_MagneticCardGetData(0);	
				        str += "磁道2:";
				        str += plugin(). Global_MagneticCardGetData(1);	
				        str += "磁道3:";
				        str += plugin(). Global_MagneticCardGetData(2);	
				
				        document.getElementById("mag").value=str;
			        });
			
			        addEvent(plugin(), 'ShenZhenTong', function(ret)
			        {
				        var str = "";
				
				        str += "[深圳通卡号] ";
				        str += plugin().Global_GetShenZhenTongNumber();
						
						str += "[金额:] ";
				        str += plugin().Global_GetShenZhenTongAmount();
				
				        str += "[交易记录:]";

						var n = plugin().Global_GetShenZhenTongCardRecordNumber();
						for(var i = 0; i < n ; i++)
						{			
							str += plugin().Global_GetShenZhenTongCardRecord( i);	
							str += ";";	
						}			
				        document.getElementById("shenzhentong").value=str;
			        });			
			
			        addEvent(plugin(), 'MoveDetec', function(video, id)
			        {
				        // 自动拍照事件	
			        });
			
			        addEvent(plugin(), 'Deskew', function(video, view, list)
			        {
				        // 纠偏回调事件
				        var count = plugin().RegionList_GetCount(list);				
				        for (var i = 0; i < count; ++i)
				        {				
					        var region = plugin().RegionList_GetRegion(list, i);
					
					        var x1 = plugin().Region_GetX1(region);
					        var y1 = plugin().Region_GetY1(region);
					
					        var width = plugin().Region_GetWidth(region);
					        var height = plugin().Region_GetHeight(region);
					
					        plugin().Region_Release(region);
				        }
				
				        plugin().RegionList_Release(list);
			        });
				
			        var title = document.title;
			        document.title = title + plugin().version;
				
			        MainView().Global_SetWindowName("view");
			        AssistView().Global_SetWindowName("view");
			        thumb1().Global_SetWindowName("thumb");
		
			        var ret;
					ret = plugin().Global_InitDevs();
					if(ret)
					{
						//进行人脸识别初始化时，视频应处于关闭状态
						 plugin().InitFaceDetect();
					}
					
					if( !plugin().Global_VideoCapInit())
					{
						alert("初始化失败！");
					}
                }
		
		        function Unload()
		        {
			        if (VideoMain)
			        {
				        MainView().View_SetText("", 0);
				        plugin().Video_Release(VideoMain);
				        VideoMain = null;
			        }
			        if(DeviceMain)
			        {
				        plugin().Device_Release(DeviceMain);
				        DeviceMain = null;		
			        }
			        if (VideoAssist)
			        {
				        AssistView().View_SetText("", 0);
				        plugin().Video_Release(VideoAssist);
				        VideoAssist = null;
			        }
			        if(DeviceAssist)
			        {
				        plugin().Device_Release(DeviceAssist);
				        DeviceAssist = null;		
			        }			
			        plugin().Global_DeinitDevs();
					
					//进行人脸识别反初始化时，视频应处于关闭状态
					plugin().DeinitFaceDetect();
		        }
		        function EnableDate(obj)
		        {
			        if (obj.checked)
			        {
				        var offsetx = 1000;
				        var offsety = 60;
				
				        var font;
				        font = plugin().Global_CreateTypeface(50, 50, 0, 0, 2, 0, 0, 0, "宋体");
				
				        if (VideoMain)
				        {
					        var width = plugin().Video_GetWidth(VideoMain);
					        var heigth = plugin().Video_GetHeight(VideoMain);
					
					        plugin().Video_EnableDate(VideoMain, font, width - offsetx, heigth - offsety, 0xffffff, 0);
				        }
				        if (VideoAssist)
				        {
					        var width = plugin().Video_GetWidth(VideoAssist);
					        var heigth = plugin().Video_GetHeight(VideoAssist);	
					
					        plugin().Video_EnableDate(VideoAssist, font, width - offsetx, heigth - offsety, 0xffffff, 0);
				        }
				        plugin().Font_Release(font);
			        }
			        else
			        {
				        if(VideoMain)
				        {
					        plugin().Video_DisableDate(VideoMain);
				        }
				        if(VideoAssist)
				        {
					        plugin().Video_DisableDate(VideoAssist);
				        }
			        }
		        }
		
		        function AddText(obj)
		        {
			        if (obj.checked)
			        {			
				        var font;
				        font = plugin().Global_CreateTypeface(200, 200, 0, 0, 2, 0, 0, 0, "宋体");
				
				        if (VideoMain)
				        {				
					        plugin().Video_EnableAddText(VideoMain, font, 0, 0, "文字水印", 65280, 150);
				        }
				        if (VideoAssist)
				        {
					        plugin().Video_EnableAddText(VideoAssist, font, 0, 0, "文字水印", 65280, 150);
				        }
				        plugin().Font_Release(font);
			        }
			        else
			        {
				        if(VideoMain)
				        {
					        plugin().Video_DisableAddText(VideoMain);
				        }
				        if(VideoAssist)
				        {
					        plugin().Video_DisableAddText(VideoAssist);
				        }
			        }		
		        }
		
		        function ShowProperty()
		        {
			        if(DeviceMain)
			        {
				        plugin().Device_ShowProperty(DeviceMain, MainView().View_GetObject());
			        }
		        }
		
		        function Deskew(obj)
		        {
			        if (obj.checked)
			        {
				        if(VideoMain)
				        {
					        plugin().Video_EnableDeskewEx(VideoMain, 1);
				        }
				        if(VideoAssist)
				        {
					        plugin().Video_EnableDeskewEx(VideoAssist, 1);
				        }
			        }
			        else
			        {
				        if(VideoMain)
				        {
					        plugin().Video_DisableDeskew(VideoMain);
				        }
				        if(VideoAssist)
				        {
					        plugin().Video_DisableDeskew(VideoAssist);	
				        }		
			        }
		        }
		
		        function SetState(obj)
		        {
					if (obj.checked)
					{
						MainView().View_SetState(2);
						document.getElementById('scansize').disabled="disabled"; 
					}
					else
					{
						MainView().View_SetState(1);
						document.getElementById('scansize').disabled=""; 
					}
		        }
				function OpenVerifyFacRect(obj)
				{
					if(!initFaceDetectSuccess)
					{
						alert("人脸初始化失败，机型不支持！");
						obj.checked = false;
					}
					else
					{
						if (VideoMain)
						{
							if (obj.checked)
								plugin().Global_EnableFaceRectCrop(VideoMain, 1);
							else
								plugin().Global_DisableFaceRectCrop(VideoMain);
						}
						if (VideoAssist)
						{
							if (obj.checked)
								plugin().Global_EnableFaceRectCrop(VideoAssist, 1);
							else
								plugin().Global_DisableFaceRectCrop(VideoAssist);
						}
					}
				}
				function changescansize()
				{
					var rect;
					var width =  plugin().Video_GetWidth(VideoMain);
					var heigth =  plugin().Video_GetHeight(VideoMain);	
					
					var s = document.getElementById('scansize'); 									
					var size = s.options.selectedIndex;
					
					if(size == 0)
					{
						MainView().View_SetState(1);//取消框选 状态											
					}
					else if(size == 1)
					{
						rect = plugin().Global_CreateRect(width/2 - width/4, heigth/2 - heigth/4, width/2, heigth/2);
						MainView().View_SetState(2);//小尺寸
						MainView().View_SetSelectedRect(rect);						

					}
					else if(size == 2)
					{
						rect = plugin().Global_CreateRect(width/2 - width/6, heigth/2 - heigth/6, width/3, heigth/3);
						MainView().View_SetState(2);//中尺寸
						MainView().View_SetSelectedRect(rect);						
					}
					
					if(size != 0)
					{
						document.getElementById('SetState').checked = false; 
						document.getElementById('SetState').disabled="disabled"; 
					}
					else
					{
						document.getElementById('SetState').disabled = ""
					}
				}
		
		        function Left()
		        {
			        if(VideoMain)
			        {
				        plugin().Video_RotateLeft(VideoMain);
			        }
			        if(VideoAssist)
			        {
				        plugin().Video_RotateLeft(VideoAssist);	
			        }	

		        }
		
		        function Right()
		        {
			        if(VideoMain)
			        {
				        plugin().Video_RotateRight(VideoMain);
			        }
			        if(VideoAssist)
			        {
				        plugin().Video_RotateRight(VideoAssist);		
			        }	

		        }
		
				function GetTimeString()
				{
					var date = new Date();
					var yy = date.getFullYear().toString();
					var mm = (date.getMonth() + 1).toString();
					var dd = date.getDate().toString();
					var hh = date.getHours().toString();
					var nn = date.getMinutes().toString();
					var ss = date.getSeconds().toString();
					var mi = date.getMilliseconds().toString();
					
					var ret = yy + mm + dd + hh + nn + ss + mi;
					return ret;
				}
		
                //拍照
		        function Scan()
		        {
					rescan();//清空上一个人的数据
					var path="D:\\phpstudy\\PHPTutorial\\scan\\";
					$("#mask").show(100,function(){
						if (VideoMain) 
						{
							changescansize();//设置主摄像头扫描尺寸
							var imgList = plugin().Video_CreateImageList(VideoMain, 0, 0);
							if (imgList) {
								var len = plugin().ImageList_GetCount(imgList);
								for (var i = 0; i < len; i++) {
									var img = plugin().ImageList_GetImage(imgList, i);
									var Name = path+ GetTimeString() + ".jpg";
									var b = plugin().Image_Save(img, Name, 0);
									if (b) {
											MainView().View_PlayCaptureEffect();
											thumb1().Thumbnail_Add(Name);
											PicPath = Name;
											var method=$("#info_method").val();
											if(method=="baidu")
												get_info(Name); //身份证识别
											else if(method=="inside")
												OCR();
											else if(method=="manual")
												$("#mask").hide();
									}
									plugin().Image_Release(img);
								}
								plugin().ImageList_Release(imgList);
							}
						}
						if (VideoAssist) 
						{
							var imgList2 = plugin().Video_CreateImageList(VideoAssist, 0, 0);
							if (imgList2) {
								var len = plugin().ImageList_GetCount(imgList2);
								for (var i = 0; i < len; i++) {
									var img = plugin().ImageList_GetImage(imgList2, i);
									var Name = path+ GetTimeString() + ".jpg";
									var b = plugin().Image_Save(img, Name, 0);
									if (b) {
										ajax_upload(Name);//上传文件
										AssistView().View_PlayCaptureEffect();
										thumb1().Thumbnail_Add(Name);
									}
									else{
										alert("保存文件失败");
									}
									plugin().Image_Release(img);
								}

								plugin().ImageList_Release(imgList2);
							}
						}
					  });
		        }
				//仅拍身份证
		        function only_idcar()
		        {
					var path="D:\\phpstudy\\PHPTutorial\\scan\\";
					$("#mask").show(100,function(){
						if (VideoMain) 
						{
							changescansize();//设置主摄像头扫描尺寸
							var imgList = plugin().Video_CreateImageList(VideoMain, 0, 0);
							if (imgList) {
								var len = plugin().ImageList_GetCount(imgList);
								for (var i = 0; i < len; i++) {
									var img = plugin().ImageList_GetImage(imgList, i);
									var Name = path+ GetTimeString() + ".jpg";
									var b = plugin().Image_Save(img, Name, 0);
									if (b) {
											MainView().View_PlayCaptureEffect();
											thumb1().Thumbnail_Add(Name);
											PicPath = Name;
											var method=$("#info_method").val();
											if(method=="baidu")
												get_info(Name); //身份证识别
											else if(method=="inside")
												OCR();
											else if(method=="manual")
												$("#mask").hide();
									}
									plugin().Image_Release(img);
								}
								plugin().ImageList_Release(imgList);
							}
						}
					});
		        }
				//仅拍头像
		        function only_avator()
		        {
					var path="D:\\phpstudy\\PHPTutorial\\scan\\";
					$("#mask").show(100,function(){
						if (VideoAssist) 
						{
							var imgList2 = plugin().Video_CreateImageList(VideoAssist, 0, 0);
							if (imgList2) {
								var len = plugin().ImageList_GetCount(imgList2);
								for (var i = 0; i < len; i++) {
									var img = plugin().ImageList_GetImage(imgList2, i);
									var Name = path+ GetTimeString() + ".jpg";
									var b = plugin().Image_Save(img, Name, 0);
									if (b) {
										ajax_upload(Name);//上传文件
										AssistView().View_PlayCaptureEffect();
										thumb1().Thumbnail_Add(Name);
										$("#mask").hide();
									}
									else{
										alert("保存文件失败");
									}
									plugin().Image_Release(img);
								}

								plugin().ImageList_Release(imgList2);
							}
						}
					});
		        }
		        function OCR()
		        {
			        if (PicPath)
			        {
				        plugin().Global_InitOcr();
				        var img;
				        img = plugin().Global_CreateImageFromFile(PicPath, 0);
				        plugin().Global_DiscernOcr(1, img);
				        var b = plugin().Global_WaitOcrDiscern();
				        if (b)
				        {
					        alert(plugin().Global_GetOcrPlainText(0));
					        plugin().Global_SaveOcr("G:\\scan\\1.txt", 0);
				        }
				
				        plugin().Global_DeinitOcr();
				
				        plugin().Image_Release(img);
			        }	
			        else
			        {
				        alert("请先拍照！");
			        }
		        }
		        function UploadToHttpServer(file,name)
		        {

			        //var http = plugin().Global_CreateHttp("http://192.168.1.56:80/upload.asp");//asp服务器demo地址
			        var http = plugin().Global_CreateHttp("http://localhost/cheguan/public/admin/Upload");//php服务器demo地址
			        if (http)
			        {
				        var b = plugin().Http_UploadImageFile(http,file, name);
				        if (b)
				        {
					        alert("上传成功");
				        }
				        else
				        {
					        alert("上传失败");
				        }
				
				        plugin().Http_Release(http);
			        }
			        else
			        {
				        alert("url 错误");
			        }
		        }
				function UploadThumbToServer()
				{
					var http =thumb1().Thumbnail_HttpUploadCheckImage("http://192.168.1.56:8080/FileStreamDemo/servlet/FileSteamUpload?",0);
					if(http)
					{
						var htInfo = thumb1().Thumbnail_GetHttpServerInfo();
						alert(htInfo);
					}
					else
					{
						alert("上传失败！");
					}
				}
		        function ScanToHttpServer()
		        {
			        if(VideoMain)
			        {
				        var img = plugin().Video_CreateImage(VideoMain, 0, MainView().View_GetObject());
				        if (img)
				        {
					        //var http = plugin().Global_CreateHttp("http://192.168.1.193:8080/upload.asp");//asp服务器demo地址
					        var http = plugin().Global_CreateHttp("http://192.168.1.56:80/FileStreamDemo/servlet/FileSteamUpload?");//java服务器demo地址
					        if (http)
					        {
						        var b = plugin().Http_UploadImage(http, img, 2, 0, "2.jpg");
						        if (b)
						        {
							        alert("上传成功");
						        }
						        else
						        {
							        alert("上传失败");
						        }
						
						        plugin().Http_Release(http);
					        }

					        plugin().Image_Release(img);
				        }
			        }
		        }
				
				function RGB(r, g, b)
				{
					return r | g<<8 | b<<16;
				}
				
				/******************录像********************/
		        function StartMainRecord()
		        {
					if(VideoMain)
					{
						var videoOutputWidth = plugin().Video_GetWidth(VideoMain);
						var videoOutputHeight = plugin().Video_GetHeight(VideoMain);
						//录像时，打开视频的分辨率越低，帧率越高,一般不超过200w像素
						//所设置的帧率应尽可能高于实际帧率，避免丢帧
						var FrameRate = 15;//此参数可根据录像分辨率与机型实际帧率调节
						var CheckWidth = 1600;
						var CheckHeight = 1200;
						//主流视频分辨率少有大于200万的，因此为节约cpu资源，当分辨率大于200w，应采用200w的配置录制
						if (videoOutputWidth * videoOutputHeight > (CheckWidth * CheckHeight))
						{
							if(confirm("当前分辨率过高，切换到200万像素时，录制效果最佳！\r\n点击'确定'，手动切换到1600X1200或相近分辨率后再次尝试\r\n点击'取消'，本次录制继续"))
							{
								return;
							}
							videoOutputWidth = CheckWidth;
							videoOutputHeight = CheckHeight;
						}
					
						if(	videoCapMain)
						{
							plugin().VideoCap_Stop(videoCapMain);
							plugin().VideoCap_Destroy(videoCapMain);
						}
						
						videoCapMain = plugin().Global_CreatVideoCap();
						if(null == videoCapMain)
						{
							alert("创建录像对象失败");
							return;
						}
						
						//设置水印
						plugin().VideoCap_SetWatermark(videoCapMain, 1, 0, 0, 4, 100, 0, "深圳新良田科技", RGB(255,23,140), "Microsoft YaHei", 72, 50, 0);
						
						var selMicIdx = -1;
						if(plugin().Global_VideoCapGetAudioDevNum() > 0)//有麦克风
						{
							selMicIdx = 0;
						}
						
						if(!plugin().VideoCap_PreCap(videoCapMain, "C:\\eloamPlugin_main.mp4", selMicIdx, FrameRate, 1, videoOutputWidth, videoOutputHeight))
						{
							alert("录像设置失败");
							return;
						}
						
						if(!plugin().VideoCap_AddVideoSrc(videoCapMain, VideoMain))
						{
							alert("添加视频源失败");
							return;
						}
						
						if(!plugin().VideoCap_Start(videoCapMain))
						{
							alert("启动录像失败");
							return;
						}
						alert("已开始录像");
					}
		        }
		        function StopMainRecord()
		        {
					if(plugin().VideoCap_Stop(videoCapMain))
					{
						plugin().VideoCap_Destroy(videoCapMain);
						videoCapMain = null;
						alert("录像结束，文件保存于C:\\eloamPlugin_main.mp4\r\n若录像失败请选择较小的分辨率尝试");
					}
					else
					{
						alert("停止录像失败");
					}
		        }
				function StartAssistRecord()
		        {
					if(VideoAssist)
					{
						var videoOutputWidth = plugin().Video_GetWidth(VideoAssist);
						var videoOutputHeight = plugin().Video_GetHeight(VideoAssist);
						//录像时，打开视频的分辨率越低，帧率越高,一般不超过200w像素
						//所设置的帧率应尽可能高于实际帧率，避免丢帧
						var FrameRate = 15;//此参数可根据录像分辨率与机型实际帧率调节
						var CheckWidth = 1600;
						var CheckHeight = 1200;
						//主流视频分辨率少有大于200万的，因此为节约cpu资源，当分辨率大于200w，应采用200w的配置录制
						if (videoOutputWidth * videoOutputHeight > (CheckWidth * CheckHeight))
						{
							if(confirm("当前分辨率过高，切换到200万像素时，录制效果最佳！\r\n点击'确定'，手动切换到1600X1200或相近分辨率后再次尝试\r\n点击'取消'，本次录制继续"))
							{
								return;
							}
							videoOutputWidth = CheckWidth;
							videoOutputHeight = CheckHeight;
						}
					
						if(	videoCapAssist)
						{
							plugin().VideoCap_Stop(videoCapAssist);
							plugin().VideoCap_Destroy(videoCapAssist);
						}
						
						videoCapAssist = plugin().Global_CreatVideoCap();					
						if(null == videoCapAssist)
						{
							alert("创建录像对象失败");
							return;
						}
						
						//设置水印
						plugin().VideoCap_SetWatermark(videoCapAssist, 1, 0, 0, 1, 220, 0, "深圳新良田科技", RGB(255,23,140), "Microsoft YaHei", 72, 50, 0);
						
						var selMicIdx = -1;
						if(plugin().Global_VideoCapGetAudioDevNum() > 0)//有麦克风
						{
							selMicIdx = 0;
						}
						
						if(!plugin().VideoCap_PreCap(videoCapAssist, "C:\\eloamPlugin_assist.mp4", selMicIdx, FrameRate, 1, videoOutputWidth, videoOutputHeight))
						{
							alert("启动录像失败");
							return;
						}
						
						if(!plugin().VideoCap_AddVideoSrc(videoCapAssist, VideoAssist))
						{
							alert("添加视频源失败");
							return;
						}
						
						if(!plugin().VideoCap_Start(videoCapAssist))
						{
							alert("启动录像失败");
							return;
						}
						alert("已开始录像");
					}
		        }
		        function StopAssistRecord()
		        {
					if(plugin().VideoCap_Stop(videoCapAssist))
					{
						plugin().VideoCap_Destroy(videoCapAssist);
						videoCapAssist = null;
						alert("录像结束，文件保存于C:\\eloamPlugin_assist.mp4\r\n若录像失败请选择较小的分辨率尝试");
					}
					else
					{
						alert("停止录像失败");
					}
		        }
				/******************录像********************/
		        function GetImgMD5()
		        {		
			        if(PicPath)
			        {
				        var img;
				        img = plugin().Global_CreateImageFromFile(PicPath, 0);
				        var md5 = plugin().Image_GetMD5(img, 2, 0);
				        alert("图像的MD5值为：" + md5);
				
				        plugin().Image_Release(img);
			        }
			        else
			        {
				        alert("请先拍照！");
			        }
		        }
        
		        function Barcode()
		        {
					if (DeviceMain)
					{
						if (VideoMain)
						{
							var imgList = plugin().Video_CreateImageList(VideoMain, 0, 0);
							if (imgList) 
							{
								plugin().Global_InitBarcode();
							
								var len = plugin().ImageList_GetCount(imgList);
								for (var i = 0; i < len; i++) 
								{
									var image = plugin().ImageList_GetImage(imgList, i);

									if (image)
									{
										var b = plugin().Global_DiscernBarcode(image);
										if (b)
										{
											if(plugin().Global_GetBarcodeCount() <= 0)
											{
												alert("识别失败！");
											}
											else
											{
												for(var i = 0 ; i < plugin().Global_GetBarcodeCount(); i++)
													alert(plugin().Global_GetBarcodeData(i));										
											}
										}						
									}
								}
								plugin().ImageList_Release(imgList);
								plugin().Global_DeinitBarcode();
							}
						}
					}
		        }
		     
			
				/*以下是自己写的函数*/
				//重拍即清空数据
				function rescan(){
					//清空缩略图列表
					var c=thumb1().Thumbnail_Clear(false);
					var num=thumb1().Thumbnail_GetCount();
					//清空用户信息
					$("#user_info input[name='name']").val("");
					$("#user_info input[name='sex']").val("");
					$("#user_info input[name='card_num']").val("");
					$("#user_info input[name='mobile']").val("");
					$("#user_info textarea[name='address']").val("");
					$(".serial").val("");
					$("#avator").html("尚未拍照");
					//向服务器请求新的序列号
					$.ajax({
						type: "POST",
						url:"{:Url('Member/ajax_code')}",
						data:{},
						async: false,
						error: function(request) {
							alert("服务器无法提供给一个正确的序列号，请刷新网页");
						},
						success: function(data) {
							
							$(".serial").val(data);
						}
					});
				}
				//保存用户信息并清空数据
				function save_member(){

					var name=$("#user_info input[name='name']").val();
				/*	var sex=$("#user_info input[name='sex']").val();*/
					var card_num=$("#user_info input[name='card_num']").val();
					var school=$("#school option:checked").text();
				/*	var mobile=$("#user_info input[name='mobile']").val();*/
					var car_type=$("#user_info input[name='card_type']").val();
					if(!/^([\u4E00-\u9FFF]|\w){2,11}$/.test(name))
					{
						alert("姓名格式不正确");
						$("#user_info input[name='name']").focus();
					}else if(card_num==null||card_num==""){
						alert("身份证信息不能为空，请手动填写");
						$("#user_info input[name='card_num']").focus();
						return false;
					}else if(school==null||school==""){
						alert("驾校名称不能为空，请手动填写");
						$("#user_info input[name='school']").focus();
						return false;
					}else{
						$.ajax({
								type: "POST",
								url:"{:Url('Member/add')}",
								data:$("#user_info").serialize(),
								async: false,
								error: function(request) {
									alert("系统繁忙，请稍后重试...");
								},
								success: function(data) {
									alert("保存信息成功");
									rescan(); //清空数据，开始下一个用户。
								}
						});
					}
				}
				//保存用户信息但不清空数据
				function save_member_print(){
					var name=$("#user_info input[name='name']").val();
				/*	var sex=$("#user_info input[name='sex']").val();*/
					var card_num=$("#user_info input[name='card_num']").val();
			
					
					var school=$("#school").val();
				/*	var mobile=$("#user_info input[name='mobile']").val();*/
					var car_type=$("#user_info input[name='card_type']").val();
					if(!/^([\u4E00-\u9FFF]|\w){2,11}$/.test(name))
					{
						alert("姓名格式不正确");
						$("#user_info input[name='name']").focus();
						return false;
					}
					else if(card_num==null||card_num==""){
						alert("身份证信息不能为空，请手动填写");
						$("#user_info input[name='car_num']").focus();
						return false;
					}else if(school==null||school==""){
						alert("驾校名称不能为空，请手动填写");
						$("#user_info input[name='school']").focus();
						return false;
					}
					else{
						$.ajax({
								type: "POST",
								url:"{:Url('Member/add')}",
								data:$("#user_info").serialize(),
								async: false,
								error: function(request) {
									alert("系统繁忙，请稍后重试...");
								},
								success: function(data) {
									alert("保存信息成功");
								}
						});
						return true;
					}
				}
				//ajax上传文件,file为本地文件的绝对路径
				function ajax_upload(file){
					var img=plugin().Global_CreateImageFromFile(file, 0); //从文件创建图像句柄
					var base64=plugin().Image_GetBase64(img,2,0); //转成base64
					$.ajax({
							type: "POST",
							url:"{:Url('Upload/base64')}",
							data:{'file':base64},
							async: true,
							error: function(request) {
								alert("上传头像照片失败，请按\"仅拍头像\"重拍学员头像");
							},
							success: function(data) {
								data.replace(/\\/g, "");
								data.replace(/\"/g, "");
								$("#user_info input[name='avator']").val(data);
								$("#avator").html("<img style='height:4.9cm;width:3.9cm' src='/cheguan/"+data+"' />");
								
							}
					});
				}
				//ajax返回身份证信息
				function get_info(name)
				{
					$.ajax({
							cache: true,
							type: "POST",
							url:"{:Url('Baidu/get_idcar_info')}",
							data:{'name':name},
							async: true,  //true 异步，false同步，同步时浏览器将被锁死
							timeout:43000,//设置超时时间，建议设置比php最大执行时间小
							beforeSend:function(){
								
							},
							error: function(request) {
								alert("请求身份证信息超时，请重拍信息");
								$("#mask").hide();
							},
							success: function(data) {
								$("#mask").hide();
								var obj = eval('(' + data + ')');
									//console.log(obj);
									/*以下判断条件均由百度接口返回数据作为依据*/
									if(obj.error_code!=""&&obj.error_code!=null&&obj.error_code!="undentify")
									{
										$("#mask").hide();
										alert("无法识别身份证信息，请重拍或手动输入");
									}
									else if(obj.err!="undentify"&&obj.err!=""&&obj.err!=null)  //该错误由后台curl提供
									{
										$("#mask").hide();
										alert("无法识别身份证信息，curl请求错误，请重拍或手动输入");
									}
									else if(obj.words_result=="undentify"||obj.words_result==""||obj.words_result==null)
									{
										$("#mask").hide();
										alert("无法识别身份证信息，请重拍或手动输入");
									}
									else{
										$("#user_info input[name='name']").val(obj.words_result.姓名.words);
										$("#user_info input[name='sex']").val(obj.words_result.性别.words);
										$("#user_info input[name='card_num']").val(obj.words_result.公民身份号码.words);
										$("#user_info textarea[name='address']").val(obj.words_result.住址.words);
										$("#mask").hide();
									}
									$("#mask").hide();
							}
					});
				}
			//刷新网页
			function refresh(){
				window.location.reload();
			}
        </script>
		<script>
			function bindData(){
				//搞定 type=text, 同时如果checkbox,radio,select>option的值有变化, 也绑定一下, 这里忽略button
				$("input,select option").each(function(){
					$(this).attr('value',$(this).val());
				});
				
				//搞定 type=checkbox,type=radio 选中状态
				$("input[type='checkbox'],input[type='radio']").each(function(){
					if($(this).attr('checked'))
						$(this).attr('checked',true);
					else
						$(this).removeAttr('checked');
				});
				
				//搞定select选中状态
				$("select option").each(function(){
					if($(this).attr('selected'))
						$(this).attr('selected',true);
					else
						$(this).removeAttr('selected');
				});
				
				//搞定 textarea
				$("textarea").each(function(){
					$(this).html($(this).val());
				});
				
			}

			//保存并打印
			function preview()         
			{   
				bindData();
				var save=save_member_print(); //保存用户信息
				if(save)
				{

					bindData();
					$("#table_box").jqprint(); //打印插件
				}
			}
			//仅拍照
			function print()         
			{  
				bindData();
				$("#table_box").jqprint(); //打印插件
			}

			function choose(val){
				var school=$("#school option:selected").text();
				$(".school").html(school);
			}
			$(document).ready(function () {
				$("#scansize").val("small");
				//选择申请车型
				var img="<img src='__STATIC__/images/check.png' style='height:16px;width:16px;padding:0;margin:0 0 1px 0px;' />";
				$(".mycheck").change(function() {
					var k=$(this).attr("data-k");
					$(".card_type").html("");
					$("#label"+k).html(img);
				});
				//防止label for 不起效
				$(".card_type").click(function(e){
					e.preventDefault(); 
					$("#"+$(this).attr("for")).click().change(); 
				});
				$("#scan").click(function(){
					
				});
			});

		</script>  
		<style>
			#table_box{margin:0 auto;}
			#pic_box{float:left;margin-right:0px;}
			.line1{margin:15px 0px;}
			#mask{background-color:#333;width:320px;;position:absolute;top:50%;left:40%;
			padding:30px 20px;border-radius:5px;color:#fff;filter:Alpha(opacity=80);display:none;}
			select{height:22px;border:1xp solid #ccc;}
			#retime{color:red;}
		</style>
    </head>
	
<body onload="Load()" onunload="Unload()">
	<div id="pic_box" style="height:25cm;border-right:1px solid #ccc;padding-right:15px;width:853px;">
		<div>
			<object id="view1" type="application/x-eloamplugin" width="403" height="300" name="view"></object>
			<object id="view2" type="application/x-eloamplugin" width="403" height="300" name="view"></object>
		</div>
		<div>
			<object id="thumb1" type="application/x-eloamplugin" width="810" height="150" name="thumb"></object>
		</div>
		<tr>
			<td>
				<div class="line1">
				<label id="lab1">设备1</label>
				<select id="subType1" style="width: 90px" name="subType1" onchange="changesubTypeMain()"></select> 
				<select id="selRes1" style="width: 90px" name="selRes"></select> 
				扫描尺寸<select id="scansize" style="width: 90px" name="scansize" onchange="changescansize()">			
					<option value ="org">原始</option>
					<option value ="mid">中</option>
					<option value="small">小</option>
				</select> 
				<label id="lab2">设备2</label>
				<select id="subType2" style="width: 90px" name="subType2" onchange="changesubTypeAssist()"></select> 
				<select id="selRes2" style="width: 90px" name="selRes"></select> 		
				<input class="submit_01" type="button" id="scan" value="拍照"	onclick="Scan()" style="border:none;padding:8px 25px;background-color:#43cd6e;color:#fff;font-size:16px;" />
				<input class="submit_01" type="button" value="仅身份证"	onclick="only_idcar()" style="border:none;padding:8px 5px;background-color:#ccc;font-size:16px;"/>
				</div>
				<input class="submit_01" type="hidden" value="上传本地文件"	onclick="UploadToHttpServer()" />
				<input class="submit_01" type="button" value="打开摄像头" onclick="OpenVideo()" style="border:none;padding:10px 5px;background-color:#ccc;font-size:12px;"/>
				<input class="submit_01" type="button" value="关闭摄像头" onclick="CloseVideo()" style="border:none;padding:10px 5px;background-color:#ccc;font-size:12px;"/>
				<b>|</b>
				身份信息填写方式<select id="info_method" style="width: 90px;margin-left:5px;" name="info_method" >			
					<option value ="baidu">百度算法</option>
					<option value="manual">手动填写</option>
				</select> 
				<!--<input id="EnableDate" type="checkbox" value="" onclick="EnableDate(this)" />日期
				<input id="AddText" type="checkbox" value="" onclick="AddText(this)" />文字-->
				<input id="Deskew" type="checkbox" value="" onclick="Deskew(this)" />纠偏
				<input id="SetState" type="checkbox" value="" onclick="SetState(this)" />手动框选
				<input class="submit_01" type="button" value="刷新网页"	onclick="refresh()" style="border:none;padding:8px 9px;background-color:#ccc;font-size:16px;margin-left:53px;"/>
				<input class="submit_01" type="button" value="清空表格"	onclick="rescan()" style="border:none;padding:8px 9px;background-color:#ccc;font-size:16px;margin-left:6px;"/>
				<input class="submit_01" type="button" value="仅拍头像"	onclick="only_avator()" style="border:none;padding:8px 5px;background-color:#ccc;font-size:16px;"/>
				<div style="display:none;">
				<input id="OpenVerifyFacRect" type="checkbox" value="" onclick="OpenVerifyFacRect(this)" />脸部裁剪	
				<br />
				<input class="submit_01" type="button" value="左转"	onclick="Left()" />
				<input class="submit_01" type="button" value="右转"	onclick="Right()" />
				<input class="submit_01" type="button" value="属性"	onclick="ShowProperty()" />
				<b>|</b>
				<input class="submit_01" type="button" value="主头录像"	onclick="StartMainRecord()" />
				<input class="submit_01" type="button" value="停止"	onclick="StopMainRecord()" />
				<input class="submit_01" type="button" value="副头录像"	onclick="StartAssistRecord()" />
				<input class="submit_01" type="button" value="停止"	onclick="StopAssistRecord()" />		
				<b>|</b>
				<input class="submit_01" type="button" value="缩略图多张上传"	onclick="UploadThumbToServer()" />
				<input class="submit_01" type="button" value="上传本地文件"	onclick="UploadToHttpServer()" />
				<input class="submit_01" type="button" value="扫描直接上传"	onclick="ScanToHttpServer()" />
				<b>|</b>
				<input class="submit_01" type="button" value="条码/二维码识别"	onclick="Barcode()" />
				<input class="submit_01" type="button" value="MD5" onclick="GetImgMD5()" />
				<input class="submit_01" type="button" value="OCR" onclick="OCR()" />
				<br />
				<input class="submit_01" type="button" value="初始化"	onclick="InitBiokey()" />
				<input class="submit_01" type="button" value="采集指纹特征"	onclick="GetFeature()" />
				<img src=""  id="BiokeyImg2" alt="指纹图像2" width=20 height=20/>
				<input class="submit_01" type="button" value="停止采集特征"	onclick="StopGetFeature()" />
				<input class="submit_01" type="button" value="采集指纹模板"	onclick="GetTemplate()" />
				<img src=""  id="BiokeyImg1" alt="指纹图像1" width=20 height=20/>
				<input class="submit_01" type="button" value="停止采集模板"	onclick="StopGetTemplate()" />
				<input class="submit_01" type="button" value="指纹对比" onclick="BiokeyVerify()" />
				<input class="submit_01" type="button" value="反初始化"	onclick="DInitBiokey()" />
				<b>|</b>
				<input class="submit_01" type="button" value="人脸识别" onclick="FaceDetect()" />
				<input class="submit_01" type="button" value="人证比对" onclick="VerifyFaceDetect()" />
				<br />
				<input class="submit_01" type="button" value="启动二代证阅读" onclick="StartIDCard()" />
				<input class="submit_01" type="button" value="停止阅读" onclick="StopIDCard()" />
				<input class="submit_01" type="button" value="单次读取二代证" onclick="ReadIDCard()" />
				<img src=""  id="idcardimg" alt="二代证图像" width=20 height=20/>
				<b>|</b>
				<b>|</b>
				<input class="submit_01" type="button" value="启动磁条卡阅读" onclick="StartMagCard()" />
				<input class="submit_01" type="button" value="停止阅读" onclick="StopMagCard()" />
				<b>|</b>
				<input class="submit_01" type="button" value="启动深圳通阅读" onclick="StartShenZhenTongCard()" />
				<input class="submit_01" type="button" value="停止阅读" onclick="StopShenZhenTongCard()" />
				<br />
				<input type="text" id="message" size = "195"/>
				<input type="text" id="idcard" size = "195"/>
				<input type="text" id="biokey" size = "195"/>
				<input type="text" id="reader" size = "195"/>
				<input type="text" id="mag" size = "195"/>
				<input type="text" id="shenzhentong" size = "195"/>
				</div>
			</td>
		</tr>
		<div style="margin:200px 0 0 20px;float:right;">
		<input style="margin-right:25px;background-color:#28a3ef;border:none;color:#fff;padding:12px 7px;font-size:16px;" 
		class="btn" id="btnPrint" type="button" value="保存并打印" onclick="preview()" />
		<button style="background-color:#28a3ef;border:none;color:#fff;padding:12px 15px;font-size:16px;" onclick="save_member()">保存</button>
		<button style="background-color:#28a3ef;border:none;color:#fff;padding:12px 15px;font-size:16px;" onclick="print()">仅打印</button>
	</div>

	</div>
	<div id="table_box">
	  <form id="user_info">

		<table border="0" class="print_table">
			
		  <tr style="height:60px;border:1px solid transparent;">
			<td colspan="9" style="text-align:center;padding-left:2px;font-size:12px !important;border:1px solid transparent;">
				<span style="font-size:24px;font-weight:600;">{$info.title}</span>
			</td>
		  </tr>

		  <tr style="border:1px solid transparent;border-bottom:1px solid #000;">
		  </tr>
		
		  <tr>
		  	<td width="120px;" style="text-align:center;padding-left:2px;font-size:20px !important;border:1px solid #000;">日期</td>
		  	<td style="padding-left:10px;font-size:20px !important;border:1px solid #000;">
		  		<input type="text" name="edu_date" value="{$date}" style="border:none;font-size:20px;font-family:'宋体','Arial Narrow';"/>
		  	</td>
		  	 
		  	<td width="120px;" style="text-align:center;padding-left:2px;font-size:20px !important;border:1px solid #000;">学员姓名</td>
		  	<td  style="padding-left:10px;font-size:20px !important;border:1px solid #000;">
		  		<input type="text" name="name" value="" style="border:none;width:90%;font-size:16px;font-family:'宋体','Arial Narrow';"/>
		  	</td>
		  	<td rowspan="3" id="avator" style="width:3.6cm;height:5cm;text-align:center;vertical-align:middle;border:1px solid #000;">
				相片
			</td>
		  </tr>
		  <tr>
		  	<td width="120px;"  style="text-align: center;font-size:20px !important;border:1px solid #000;border-top:1px solid transparent">身份证信息</td>
		  	<td id="card_num" style="padding-left:10px;font-size:20px !important;border:1px solid #000;border-top:1px solid transparent">
		  		<input type="text" name="card_num" value="" style="border:none;width:90%;font-size:16px;font-family:'宋体','Arial Narrow';"/>
		  	</td>
		  	<td width="100px" style="text-align: center;font-size:20px !important;border:1px solid #000;border-top:1px solid transparent">驾校名称</td>
		
		  	<td style="padding-left:10px;font-size:20px !important;border:1px solid #000;border-top:1px solid transparent;">
		  		 <select id="school" name="school" onchange="choose(this.value)"> 
		  			 {volist name="school" id="vo" key="k"}
		  			 		<option  value="{$vo.name}">{$vo.name}</option>
		  			 {/volist}
		  		</select>  	
		  		<span class="school">{$defaut_school['name']}</span>
		  	</td>
		  </tr>
		  <tr>
		  	<td width="120px;" style="text-align: center;font-size:20px !important;border:1px solid #000;border-top:1px solid transparent">申请车型</td>
		  	<td colspan="3"  style="padding:0 10px;font-size:20px !important;border:1px solid #000;border-top:1px solid transparent">
		  	 {volist name="card_type" id="vo" key="k"}
					{if condition="$vo.isdefault eq 1"}
						<Span style="float:left;">{$vo.name}</span><input class="mycheck" style="display:none;" checked="checked" type="radio" name="car_type" data-k="{$k}" id="mycheck{$k}" value="{$vo.id}" />
						<div for="mycheck{$k}" id="label{$k}" class="card_type" style="background-color: #FFF; border: 1px solid #000;height:16px;width:18px;
					display: inline-block; float:left; margin: 0 25px 0 2px;"><img src='__STATIC__/images/check.png' style="height:16px;width:16px;padding:0;margin:0 0 1px 0px;"/></div>
					{else /}
						<Span style="float:left;">{$vo.name}</span><input class="mycheck" style="display:none;" type="radio" name="car_type" data-k="{$k}" id="mycheck{$k}" value="{$vo.id}" />
						<div for="mycheck{$k}" id="label{$k}" class="card_type" style="background-color: #FFF; border: 1px solid #000;height:16px !important;width:18px !important;
					display: inline-block; float:left; margin: 0 25px 0 2px;"></div>
					{/if}
				{/volist}
		  	</td>
		  </tr>
		   <tr>
		  	<td width="120px;" style="text-align: center;font-size:16px !important;border:1px solid #000;border-top:1px solid transparent">培训路口</td>
		  	<td colspan="4" style="text-align: center; padding:15px 25px 40px 15px;font-size:20px !important;border:1px solid #000;">
		  		{volist name="route" id="vo"}
		  		<p style="font-weight: bold;text-align: center;">{$vo.cate_name}：</p>
		  		{volist name="vo['data']" id="vv"}
		  		<div style="margin-bottom:10px;line-height: 25px;vertical-align: middle;display: inline-block;margin-right: 30px;">
			  		<div for="" id="" class="card_type" style="background-color: #FFF; border: 1px solid #000;height:14px !important;width:14px !important;display: inline-block;">
			  		</div>
					<span style="font-size:19px;">{$vv['name']}</span>
		  		</div>
		  		{/volist}
		  	   {/volist}
		  		
		  	<td>
		  </tr>
		  <tr>
		  	<td colspan="5" style="padding:20px 10px 20px 50px;font-size:20px !important;border:1px solid #000;">
		  		<span style="margin-right: 200px">参加交通安全文明驾驶常识教育学员签字：</span><span style="margin-right: 30px">年</span><span style="margin-right: 30px">月</span><span>日</span>
		  	</td>
		  </tr>
		  <tr>
		  	<td rowspan="2" width="120px;" style="text-align: center;font-size:20px !important;border:1px solid #000;border-top:1px solid transparent">培训结果
		  	</td> 	
          </tr>
          <tr>
		  	<td colspan="4" style="text-align: center; padding:30px 88px;font-size:20px !important;border:1px solid #000;vertical-align: middle;">
		  		<span>合格</span>
		  		<div style="line-height: 30px;vertical-align: middle;display: inline-block;margin-right: 50px;margin-left: 15px;">
			  		<div for="" id="" class="card_type" style="background-color: #FFF; border: 1px solid #000;height:16px !important;width:18px !important;display: inline-block;">
			  			<input type="radio" name="" style="display: none" class="mycheck">
			  		</div>
		  		</div>
		  		<span>不合格</span>
		  		<div style="line-height: 30px;vertical-align: middle;display: inline-block;margin-right: 50px;margin-left:15px;">
			  		<div for="" id="" class="card_type" style="background-color: #FFF; border: 1px solid #000;height:16px !important;width:18px !important;display: inline-block;">
			  			<input type="radio" name="" style="display: none" class="mycheck">
			  		</div>
		  		</div>
		  	</td>
          </tr>
		  <tr>
		  	<td width="120px;" style="text-align: center;font-size:20px !important;border:1px solid #000;border-top:1px solid transparent;">大队审核意见</td>
		  	<td  colspan="4" style="text-align: left; padding:30px 15px;font-size:20px !important;border:1px solid #000;">
		  		<input type="text" name="" value="" style="border:none;width:45%;font-size:16px;font-family:'宋体','Arial Narrow';margin-right: 20px;"/>
		  		民警签字（盖章）：
		  	</td>
		  </tr>
		  <tr>
		  	<td colspan="5" style="text-align: center; padding:30px 15px;font-size:14px !important;font-weight: bold;border:1px solid #000;">{$info.remark}</td>
		  </tr>
		</table>
      </form>
      <div style="text-align: center;margin-top: 50px;"><img src='__STATIC__/images/code01.jpg' style="width: 200px;height: 200px;margin-right: 50px"><img src='__STATIC__/images/code02.jpg' style="width: 200px;height: 200px"></div>
	</div>
	<div id="mask">
		<div id="msg">正在识别身份证或上传照片，请稍等......</div>
	</div>
    </body>
</html>
